import { playerType } from "./gameType";


export default class playerModel {

    info: playerType = null;
    constructor(data: playerType) {
        this.info = data; 
    }   
    attack(money: number, other: playerType) {
        this.info.attackArr.push(money);
        this.info.money -= money;
    }
    // 抵消攻击
    dismiss(other: playerType) {
        this.info.attackArr.shift();
    }
    //被攻击
    hurt() {
        this.info.hp --;
    }
}